***************************************
*          @@  FLEX 3 @@              *                  
*                                     *
*   ------ >> Chapitre 6 << ------    *
*                                     *
***************************************






<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

	<mx:ApplicationControlBar x="10" y="10" dock="true">
	    <mx:Label text="Rechercher :" id="lab_rechercher"/>
	    <mx:TextInput id="txt_rechercher"/>
	    <mx:Button label="Ok" width="42" id="btn_ok"/>
	</mx:ApplicationControlBar>
	
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

	<mx:Canvas id="cn1" x="54" y="48" width="200" height="200">
	    <mx:Button x="51" y="93" label="Valider" id="btn_valider"/>
	</mx:Canvas>

</mx:Application>
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

	<mx:Label id="lab" x="10" y="5" text="HBox" width="151" fontWeight="bold"/>
	<mx:HBox id="hb" x="10" y="29" width="151">
	    <mx:Button label="B1" id="btn_1"/>
	    <mx:Button label="B2" id="btn_2"/>
	    <mx:Button label="B3" id="btn_3"/>
	</mx:HBox>
	
	<mx:Label id="lab2" x="220" y="5" text="VBox" width="151" fontWeight="bold"/>
	<mx:VBox id="vb" x="220" y="29" height="116">
	    <mx:Button label="B4" id="btn_4"/>
	    <mx:Button label="B5" id="btn_5"/>
	    <mx:Button label="B6" id="btn_6"/>
	</mx:VBox>
	
</mx:Application>




<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
	
	<mx:Label id="lab" x="10" y="17" text="HDividedBox" fontWeight="bold"/>
	<mx:HDividedBox id="hdb" x="10" y="43" width="540" height="116">
	    <mx:Canvas id="cv1" width="200" height="115" backgroundColor="#BCB8B8">
	    </mx:Canvas>
    <mx:Canvas id="cv2" width="230" height="115" backgroundColor="#F9F8F8">
	    </mx:Canvas>
	</mx:HDividedBox>
	
	<mx:Label id="lab2" x="10" y="172" text="VDividedBox" fontWeight="bold"/>
	<mx:VDividedBox id="vdb" x="10" y="198" height="312" width="540">
	    <mx:Canvas id="cv3" width="539" height="200" backgroundColor="#BCB8B8">
	    </mx:Canvas>
	    <mx:Canvas id="cv4" width="541" height="200" backgroundColor="#FBFBFB">
	    </mx:Canvas>
	</mx:VDividedBox>
		
</mx:Application>



<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

	<mx:Form x="10" y="19" width="269" height="168">
		    <mx:FormHeading label="Nouvel utilisateur :"/>
	
	    <mx:FormItem id="fit1" label="Prnom :" required="true">
	        <mx:TextInput id="txt_prenom"/>
	    </mx:FormItem>
	
	    <mx:FormItem id="fit2" label="Nom :">
	        <mx:TextInput id="txt_nom"/>
	    </mx:FormItem>
	
	    <mx:FormItem id="fit3">
	        <mx:Button label="Valider" id="btn_valider"/>
	    </mx:FormItem>
	</mx:Form>
	
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
	<mx:Grid id="gd" x="10" y="10" width="212" height="198">
	    <mx:GridRow width="100%" height="100%">
	        <mx:GridItem width="100%" height="43">
	            <mx:Label text="1" fontWeight="bold" fontSize="28" height="39" width="65" textAlign="center" id="l1"/>
	        </mx:GridItem>
	        <mx:GridItem width="100%" height="100%">
	            <mx:Label text="3" fontWeight="bold" fontSize="28" height="39" width="65" textAlign="center" id="l2"/>
	        </mx:GridItem>
	        <mx:GridItem width="100%" height="100%">
	        </mx:GridItem>
	    </mx:GridRow>
	    <mx:GridRow width="100%" height="100%">
	        <mx:GridItem width="100%" height="100%">
	        </mx:GridItem>
	        <mx:GridItem width="100%" height="100%">
	            <mx:Label text="2" fontWeight="bold" fontSize="28" height="39" width="65" textAlign="center" id="l3"/>
	        </mx:GridItem>
	        	<mx:GridItem width="100%" height="100%">
	            <mx:Label text="1" fontWeight="bold" fontSize="28" height="39" width="65" textAlign="center" id="l4"/>
	        </mx:GridItem>
	    </mx:GridRow>
	    <mx:GridRow width="100%" height="100%">
	        <mx:GridItem width="100%" height="100%">
	            <mx:Label text="3" fontWeight="bold" fontSize="28" height="39" width="65" textAlign="center" id="l5"/>
	        </mx:GridItem>
	        <mx:GridItem width="100%" height="100%">
	            <mx:Label text="1" fontWeight="bold" fontSize="28" height="39" width="65" textAlign="center" id="l6"/>
	        </mx:GridItem>
	        <mx:GridItem width="100%" height="100%">
	        </mx:GridItem>
	    </mx:GridRow>
	</mx:Grid>

</mx:Application>
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

	<mx:Panel x="10" y="10" width="355" height="182" titleIcon="@Embed('login.jpg')" layout="absolute" title="Identification" id="panel_identification">
	    <mx:Form id="form" x="10" y="10" width="315" height="117">
	        <mx:FormItem id="fit1" label="Identifiant :">
	            <mx:TextInput id="id_txt"/>
	        </mx:FormItem>
	        <mx:FormItem id="fit2" label="Mot de passe :">
	            <mx:TextInput displayAsPassword="true" id="mdp_txt" text=1234/>
	        </mx:FormItem>
	        <mx:FormItem id="fit3">
	            <mx:Button label="OK" id="btn_ok"/>
	        </mx:FormItem>
	    </mx:Form>
	</mx:Panel>

</mx:Application>
<?xml version="1.0" encoding="utf-8"?>

<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
	width="248" height="204"
	title="Fentre pop-up"
	showCloseButton="true"
	close="fermerPopUp()" >
	
<mx:Script>
	    <![CDATA[
	
	    import mx.managers.PopUpManager
	
	    public function fermerPopUp():void
	    {
	        PopUpManager.removePopUp(this);
	    }
	
	    ]]>
</mx:Script>

	<mx:TextInput id="txt_message"/>
	<mx:Button label="Ok" id="btn_ok"/>
	
</mx:TitleWindow>
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
	    <![CDATA[
	
	    import mx.managers.PopUpManager;
	
	    public function ouvrirPopUp():void{
	
	    PopUpManager.createPopUp(this,popUp,true);
	
	    }
	
	    ]]>
</mx:Script>

	<mx:Button x="32" y="32" label="Afficher pop-up" click="ouvrirPopUp()" id="btn_ouvrirpopup"/>

</mx:Application>
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
	    <![CDATA[
	
	    import mx.managers.PopUpManager;
	
	    public function ouvrirPopUp():void{
	
	    <!-- Cration dun objet de type pop-up issu du fichier popUp.mxml !-->
	    var objetPopUp:popUp = popUp(PopUpManager.createPopUp(this,popUp,true));
	
	    <!-- Modification de la proprit text du champ txt_message de lobjet objetPopUp !-->
	    objetPopUp.txt_message.text = "Message transfer !";
	
	    }
	    	]]>
</mx:Script>

	<mx:Button x="32" y="32" label="Afficher pop-up" click="ouvrirPopUp()" id="btn_ouvrirpopup"/>

<mx:TextInput x="32" y="71" id="txt_messageapplication"/>

</mx:Application>
<mx:TextInput x="32" y="71" id="txt_messageapplication"/>
<?xml version="1.0" encoding="utf-8"?>

<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
	width="248" height="204"
	title="Fentre POPUPpop-up"
	showCloseButton="true"
	close="fermerPopUp()" >
	
<mx:Script>
	    <![CDATA[
	
	    import mx.managers.PopUpManager
	
	    public function fermerPopUp():void
	    {
	        PopUpManager.removePopUp(this);
	
	    }
	
	    public function envoyerMessage():void
	    {
	        parentApplication.txt_messageapplication.text = "Message reu !";
	    }
	
	    ]]>
</mx:Script>

	<mx:TextInput id="txt_message"/>

	<mx:Button label="Ok" id="btn_ok" click="envoyerMessage()"/>
		
</mx:TitleWindow>
